<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>取消预约</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../layui/css/layui.css"  media="all">
    <link rel="stylesheet" href="../../static/css/style.css"  media="all">
    <script type="text/javascript" src="../../static/js/jquery.min.js" ></script>
    <script src="../../layui/layui.js" charset="utf-8"></script>
    <script src="../../static/js/base.js" charset="utf-8"></script>
    <script src="../../static/js/ax.js"></script>
    <script src="../../static/js/jquery.cookie.js"></script>
    <script src="js/constant.js"></script>
    <script src="../../static/js/avalon.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="../../static/js/html5.js"></script>
    <script src="../../static/js/respond.js"></script>
    <![endif]-->
</head>
<body class="bg_w">

<div class="content-wrap" ms-controller="test">

    <div class="layui-row">
        <form class="layui-form layui-form-pane" id="from1">

            <div class="layui-form-item" style="padding: 20px 10%;">
                <div class="layui-form-item" style="text-align: center"><i class="layui-icon layui-icon-tips" style="font-size: 60px;color: #e18b71;"></i></div>


                <h5 style=" line-height: 30px; font-size: 18px;padding: 20px 10%;">是否确认取消<span style="color: #47bac2;padding: 0 5px;">{{@studenname}}</span>，考试时间为<span style="color: #47bac2;padding: 0 5px;">{{@examTime}}</span>，考试科目为<span style="color: #47bac2;padding: 0 5px;">{{@classname}}</span>的预约申请？？？</h5>


            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="button" id="btnClose" class="layui-btn layui-btn-primary btn-left">关闭</button>
                    <button type="button" id="btnSubmit" class="layui-btn add_btn btn-left" lay-submit lay-filter="component-form-element">提交</button>
                </div>
            </div>

        </form>
    </div>
</div>

</body>

<script>
    var vm = avalon.define({
        $id: "test",
        studenname:'',
        classname:'',
        examTime:'',
        studentid:'',

    });
    vm.$watch('onReady', function () {
        var studentname=getQueryString("name");
        var classname=getQueryString("examSubject");
        var examTime=getQueryString("time");
        var studenteid=getQueryString("studentid");

        // title = decodeURI(_t);
        // Server.UrlDecode(Request.QueryString["name"].ToString());
     vm.studenname=decodeURI(studentname);

     vm.examTime=decodeURI(examTime);
     vm.studentid=decodeURI(studenteid);
     if(classname==1){
         vm.classname='科目一'
     }
    if(classname==2){
        vm.classname='科目二'
    }
    if(classname==3){
        vm.classname='科目三'
    }
    if(classname==4){
        vm.classname='科目四'
    }

    });


    var $;
    layui.use(['layedit','form','laydate','layer','table'], function() {
        $ = layui.$;
        var form = layui.form,
            layDateTipsStartTime = layui.laydate,
            layer=layui.layer,
            table = layui.table;

        //关闭弹框
        $('#btnClose').on("click", function () {
            parent.layer.close(parent.layer.getFrameIndex(window.name));
        });


        //监听提交
        form.on('submit(component-form-element)', function(data){
            // var ss=[];
            // for(var s in vm.stuid){
            //     var list={"studentId":vm.studentid}
            //     ss.push(list)
            // }

            // console.log(JSON.stringify(ss))
            var ss=[{"studentId": vm.studentid}]
            ax.post({
                url: schoolWebUrl + '/api/studentExam/updateYueKaoExam',
                // contentType: "application/x-www-form-urlencoded",
                data: JSON.stringify(ss),
                success: function (data) {
                    if (data.code == 0) {
                        layer.msg('取消成功');

                        topFrame.location.reload();
                        setTimeout(function () {
                            parent.layer.close(parent.layer.getFrameIndex(window.name));
                        },300)
                    } else {
                        layer.msg(data.message);
                    }
                },
            });
            return false;

        });

    });
</script>
</html>